import com.adobe.cairngorm.control.CairngormEventDispatcher;

import net.optix.ip.events.SaveFirmDocketEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.InventionVO;
[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

public var _invention:InventionVO;

public function set invention(value:InventionVO):void
{
	_invention	=	value;
	
	if(value.firmID == model.firm.firmID && value.bConfirm == 1)
	{
		save.visible	=	true;
		firmDocket.editable	=	true;
	}
	else
	{
		save.visible	=	false;
		firmDocket.editable	=	false;
	}
}
public function get invention():InventionVO
{
	return _invention;
}

private function saveFirmDocket():void
{
	var vo:InventionVO	=	model.currentInvention;
	vo.firmDocket		=	firmDocket.text;
	
	var event:SaveFirmDocketEvent	=	new SaveFirmDocketEvent(vo);
	com.adobe.cairngorm.control.CairngormEventDispatcher.getInstance().dispatchEvent(event);
}